package com.heyige.dto;

import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

import javax.validation.constraints.NotNull;
import java.time.LocalDateTime;

@Data
@Schema(description = "会员相关数据传输对象")
public class MemberDto {
    
    @Schema(description = "创建会员订单请求")
    public static class CreateOrderRequest {
        @Schema(description = "会员等级ID", example = "1", requiredMode = Schema.RequiredMode.REQUIRED)
        @NotNull(message = "会员等级ID不能为空")
        private Long memberLevelId;
        
        // Getters and Setters
        public Long getMemberLevelId() {
            return memberLevelId;
        }
        
        public void setMemberLevelId(Long memberLevelId) {
            this.memberLevelId = memberLevelId;
        }
    }
    
    @Schema(description = "支付请求")
    public static class PayRequest {
        @Schema(description = "支付方式", example = "alipay", requiredMode = Schema.RequiredMode.REQUIRED)
        @NotNull(message = "支付方式不能为空")
        private String paymentMethod;
        
        @Schema(description = "支付单号", example = "2024010112345678")
        private String paymentNo;
        
        // Getters and Setters
        public String getPaymentMethod() {
            return paymentMethod;
        }
        
        public void setPaymentMethod(String paymentMethod) {
            this.paymentMethod = paymentMethod;
        }
        
        public String getPaymentNo() {
            return paymentNo;
        }
        
        public void setPaymentNo(String paymentNo) {
            this.paymentNo = paymentNo;
        }
    }
    
    @Schema(description = "订单响应")
    public static class OrderResponse {
        @Schema(description = "订单ID", example = "1")
        private Long id;
        
        @Schema(description = "用户ID", example = "1")
        private Long userId;
        
        @Schema(description = "订单号", example = "ORDER2024010112345678")
        private String orderNo;
        
        @Schema(description = "订单状态", example = "PAID")
        private String status;
        
        @Schema(description = "订单金额", example = "99.99")
        private Double amount;
        
        @Schema(description = "会员天数", example = "30")
        private Integer durationDays;
        
        @Schema(description = "会员等级ID", example = "1")
        private Long memberLevelId;
        
        @Schema(description = "会员等级名称", example = "VIP")
        private String memberLevelName;
        
        @Schema(description = "会员等级显示名称", example = "黄金会员")
        private String memberLevelDisplayName;
        
        @Schema(description = "开始时间", example = "2024-01-01T00:00:00")
        private LocalDateTime startTime;
        
        @Schema(description = "结束时间", example = "2024-01-31T23:59:59")
        private LocalDateTime endTime;
        
        @Schema(description = "支付时间", example = "2024-01-01T12:00:00")
        private LocalDateTime paidTime;
        
        @Schema(description = "创建时间", example = "2024-01-01T10:00:00")
        private LocalDateTime createdAt;
        
        // Getters and Setters
        public Long getId() {
            return id;
        }
        
        public void setId(Long id) {
            this.id = id;
        }
        
        public Long getUserId() {
            return userId;
        }
        
        public void setUserId(Long userId) {
            this.userId = userId;
        }
        
        public String getOrderNo() {
            return orderNo;
        }
        
        public void setOrderNo(String orderNo) {
            this.orderNo = orderNo;
        }
        
        public String getStatus() {
            return status;
        }
        
        public void setStatus(String status) {
            this.status = status;
        }
        
        public Double getAmount() {
            return amount;
        }
        
        public void setAmount(Double amount) {
            this.amount = amount;
        }
        
        public Integer getDurationDays() {
            return durationDays;
        }
        
        public void setDurationDays(Integer durationDays) {
            this.durationDays = durationDays;
        }
        
        public Long getMemberLevelId() {
            return memberLevelId;
        }
        
        public void setMemberLevelId(Long memberLevelId) {
            this.memberLevelId = memberLevelId;
        }
        
        public String getMemberLevelName() {
            return memberLevelName;
        }
        
        public void setMemberLevelName(String memberLevelName) {
            this.memberLevelName = memberLevelName;
        }
        
        public String getMemberLevelDisplayName() {
            return memberLevelDisplayName;
        }
        
        public void setMemberLevelDisplayName(String memberLevelDisplayName) {
            this.memberLevelDisplayName = memberLevelDisplayName;
        }
        
        public LocalDateTime getStartTime() {
            return startTime;
        }
        
        public void setStartTime(LocalDateTime startTime) {
            this.startTime = startTime;
        }
        
        public LocalDateTime getEndTime() {
            return endTime;
        }
        
        public void setEndTime(LocalDateTime endTime) {
            this.endTime = endTime;
        }
        
        public LocalDateTime getPaidTime() {
            return paidTime;
        }
        
        public void setPaidTime(LocalDateTime paidTime) {
            this.paidTime = paidTime;
        }
        
        public LocalDateTime getCreatedAt() {
            return createdAt;
        }
        
        public void setCreatedAt(LocalDateTime createdAt) {
            this.createdAt = createdAt;
        }
    }
    
    @Schema(description = "VIP状态响应")
    public static class VipStatusResponse {
        @Schema(description = "用户ID", example = "1")
        private Long userId;
        
        @Schema(description = "是否是VIP", example = "true")
        private Boolean isVip;
        
        @Schema(description = "VIP到期时间", example = "2024-01-31T23:59:59")
        private LocalDateTime vipExpireTime;
        
        @Schema(description = "剩余天数", example = "15")
        private Integer remainingDays;
        
        // Getters and Setters
        public Long getUserId() {
            return userId;
        }
        
        public void setUserId(Long userId) {
            this.userId = userId;
        }
        
        public Boolean getIsVip() {
            return isVip;
        }
        
        public void setIsVip(Boolean isVip) {
            this.isVip = isVip;
        }
        
        public LocalDateTime getVipExpireTime() {
            return vipExpireTime;
        }
        
        public void setVipExpireTime(LocalDateTime vipExpireTime) {
            this.vipExpireTime = vipExpireTime;
        }
        
        public Integer getRemainingDays() {
            return remainingDays;
        }
        
        public void setRemainingDays(Integer remainingDays) {
            this.remainingDays = remainingDays;
        }
    }
}